<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Superpixel Benchmark: IOUtil Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Superpixel Benchmark
   </div>
   <div id="projectbrief">Superpixel benchmark, tools and algorithms.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classIOUtil-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">IOUtil Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>I/O utilities.  
 <a href="classIOUtil.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="io__util_8h_source.html">io_util.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a46bb84fe3409d74aca7b2e9e2699e35e"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a46bb84fe3409d74aca7b2e9e2699e35e">readMat</a> (boost::filesystem::path file, cv::Mat &amp;mat, std::string field=&quot;mat&quot;)</td></tr>
<tr class="memdesc:a46bb84fe3409d74aca7b2e9e2699e35e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read an OpenCV matrix.  <a href="#a46bb84fe3409d74aca7b2e9e2699e35e">More...</a><br /></td></tr>
<tr class="separator:a46bb84fe3409d74aca7b2e9e2699e35e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a446a98fc423c951454037129c46eec14"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a446a98fc423c951454037129c46eec14">writeMat</a> (boost::filesystem::path file, const cv::Mat &amp;mat, std::string field=&quot;mat&quot;)</td></tr>
<tr class="memdesc:a446a98fc423c951454037129c46eec14"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a matrix to the given file.  <a href="#a446a98fc423c951454037129c46eec14">More...</a><br /></td></tr>
<tr class="separator:a446a98fc423c951454037129c46eec14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6f4ce4f5fbab56c6febfb483e40284c"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ac6f4ce4f5fbab56c6febfb483e40284c"><td class="memTemplItemLeft" align="right" valign="top">static int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classIOUtil.html#ac6f4ce4f5fbab56c6febfb483e40284c">writeArrayCSV</a> (boost::filesystem::path file, T **array, int rows, int cols, std::string separator=&quot;,&quot;, int precision=6)</td></tr>
<tr class="memdesc:ac6f4ce4f5fbab56c6febfb483e40284c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write two dimensional array to CSV file.  <a href="#ac6f4ce4f5fbab56c6febfb483e40284c">More...</a><br /></td></tr>
<tr class="separator:ac6f4ce4f5fbab56c6febfb483e40284c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab911811634c83c884c0acbc6b14c1321"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ab911811634c83c884c0acbc6b14c1321"><td class="memTemplItemLeft" align="right" valign="top">static int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classIOUtil.html#ab911811634c83c884c0acbc6b14c1321">writeMatCSV</a> (boost::filesystem::path file, const cv::Mat &amp;mat, std::string separator=&quot;,&quot;, int precision=6)</td></tr>
<tr class="memdesc:ab911811634c83c884c0acbc6b14c1321"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the content of a cv::Mat to a CSV file.  <a href="#ab911811634c83c884c0acbc6b14c1321">More...</a><br /></td></tr>
<tr class="separator:ab911811634c83c884c0acbc6b14c1321"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1b3f8c15c94c95a1e41d94bd651f3c8"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#ad1b3f8c15c94c95a1e41d94bd651f3c8">readMatCSVInt</a> (boost::filesystem::path file, cv::Mat &amp;result)</td></tr>
<tr class="memdesc:ad1b3f8c15c94c95a1e41d94bd651f3c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read CSV file into matrix.  <a href="#ad1b3f8c15c94c95a1e41d94bd651f3c8">More...</a><br /></td></tr>
<tr class="separator:ad1b3f8c15c94c95a1e41d94bd651f3c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac72206ef505345246b107ddabe12c11"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#aac72206ef505345246b107ddabe12c11">readMatCSVInt</a> (boost::filesystem::path file, int rows, int cols, cv::Mat &amp;result)</td></tr>
<tr class="memdesc:aac72206ef505345246b107ddabe12c11"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read CSV file into matrix.  <a href="#aac72206ef505345246b107ddabe12c11">More...</a><br /></td></tr>
<tr class="separator:aac72206ef505345246b107ddabe12c11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a301206e86594f7eafa2a561bef4c1eaf"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a301206e86594f7eafa2a561bef4c1eaf">readMatCSVFloat</a> (boost::filesystem::path file, cv::Mat &amp;result)</td></tr>
<tr class="memdesc:a301206e86594f7eafa2a561bef4c1eaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read CSV file into matrix.  <a href="#a301206e86594f7eafa2a561bef4c1eaf">More...</a><br /></td></tr>
<tr class="separator:a301206e86594f7eafa2a561bef4c1eaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98f41161281f66a907466baae0000483"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a98f41161281f66a907466baae0000483">readCSVHeaderString</a> (boost::filesystem::path file, std::vector&lt; std::string &gt; &amp;header)</td></tr>
<tr class="memdesc:a98f41161281f66a907466baae0000483"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read header of CSV file into string array.  <a href="#a98f41161281f66a907466baae0000483">More...</a><br /></td></tr>
<tr class="separator:a98f41161281f66a907466baae0000483"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e7c777463186a87bc2cfe24396dba41"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a9e7c777463186a87bc2cfe24396dba41">readCSVSummary</a> (boost::filesystem::path file, std::vector&lt; std::string &gt; &amp;row_headers, std::vector&lt; std::string &gt; &amp;col_headers, cv::Mat &amp;data)</td></tr>
<tr class="memdesc:a9e7c777463186a87bc2cfe24396dba41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a CSV summary file as produced by <a class="el" href="classEvaluationSummary.html" title="Given a directory of superpixel segmentations and a directory of ground truth segmentations, this class is used to generate a CSV file of statistics of different metrics. ">EvaluationSummary</a>.  <a href="#a9e7c777463186a87bc2cfe24396dba41">More...</a><br /></td></tr>
<tr class="separator:a9e7c777463186a87bc2cfe24396dba41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fa12c1903f0a602a0cb45748510c9f2"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a8fa12c1903f0a602a0cb45748510c9f2">listSubdirectories</a> (boost::filesystem::path directory, std::multimap&lt; std::string, boost::filesystem::path &gt; subdirectories)</td></tr>
<tr class="memdesc:a8fa12c1903f0a602a0cb45748510c9f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an ordered list of all subdirectories.  <a href="#a8fa12c1903f0a602a0cb45748510c9f2">More...</a><br /></td></tr>
<tr class="separator:a8fa12c1903f0a602a0cb45748510c9f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a2042854799a9885a77767b359c7b5c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a9a2042854799a9885a77767b359c7b5c">readDirectory</a> (boost::filesystem::path directory, std::vector&lt; std::string &gt; extensions, std::multimap&lt; std::string, boost::filesystem::path &gt; &amp;files, std::string prefix=&quot;&quot;, std::string suffix=&quot;&quot;, std::vector&lt; std::string &gt; exclude=std::vector&lt; std::string &gt;{})</td></tr>
<tr class="memdesc:a9a2042854799a9885a77767b359c7b5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an ordered multimap of all files in the given directory.  <a href="#a9a2042854799a9885a77767b359c7b5c">More...</a><br /></td></tr>
<tr class="separator:a9a2042854799a9885a77767b359c7b5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a582358728d3e0c09bd886db618c923e1"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a582358728d3e0c09bd886db618c923e1">readDirectory</a> (boost::filesystem::path directory, std::multimap&lt; std::string, boost::filesystem::path &gt; &amp;files, std::string prefix=&quot;&quot;, std::string suffix=&quot;&quot;)</td></tr>
<tr class="memdesc:a582358728d3e0c09bd886db618c923e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an ordered multimap of all files in the given directory.  <a href="#a582358728d3e0c09bd886db618c923e1">More...</a><br /></td></tr>
<tr class="separator:a582358728d3e0c09bd886db618c923e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5af93a2369deca17e146b1a070101e4"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#aa5af93a2369deca17e146b1a070101e4">getImageExtensions</a> (std::vector&lt; std::string &gt; &amp;extensions)</td></tr>
<tr class="memdesc:aa5af93a2369deca17e146b1a070101e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a vector containing common extensions for images.  <a href="#aa5af93a2369deca17e146b1a070101e4">More...</a><br /></td></tr>
<tr class="separator:aa5af93a2369deca17e146b1a070101e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a6b45f5d8ea7135fb612f50042deab7"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a9a6b45f5d8ea7135fb612f50042deab7">getTxtExtensions</a> (std::vector&lt; std::string &gt; &amp;extensions)</td></tr>
<tr class="memdesc:a9a6b45f5d8ea7135fb612f50042deab7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a vector containing common extensions for text files.  <a href="#a9a6b45f5d8ea7135fb612f50042deab7">More...</a><br /></td></tr>
<tr class="separator:a9a6b45f5d8ea7135fb612f50042deab7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16c52e4be85d55d18d86e2389c8642f0"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classIOUtil.html#a16c52e4be85d55d18d86e2389c8642f0">getCSVExtensions</a> (std::vector&lt; std::string &gt; &amp;extensions)</td></tr>
<tr class="memdesc:a16c52e4be85d55d18d86e2389c8642f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a vector of common CSV extensions.  <a href="#a16c52e4be85d55d18d86e2389c8642f0">More...</a><br /></td></tr>
<tr class="separator:a16c52e4be85d55d18d86e2389c8642f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>I/O utilities. </p>
<dl class="section author"><dt>Author</dt><dd>David Stutz </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a16c52e4be85d55d18d86e2389c8642f0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void IOUtil::getCSVExtensions </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; std::string &gt; &amp;&#160;</td>
          <td class="paramname"><em>extensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get a vector of common CSV extensions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">extensions</td><td>csv exnteions </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa5af93a2369deca17e146b1a070101e4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void IOUtil::getImageExtensions </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; std::string &gt; &amp;&#160;</td>
          <td class="paramname"><em>extensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets a vector containing common extensions for images. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">extensions</td><td>image extensions </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9a6b45f5d8ea7135fb612f50042deab7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void IOUtil::getTxtExtensions </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; std::string &gt; &amp;&#160;</td>
          <td class="paramname"><em>extensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Gets a vector containing common extensions for text files. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">extensions</td><td>txt extensions </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8fa12c1903f0a602a0cb45748510c9f2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void IOUtil::listSubdirectories </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>directory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::multimap&lt; std::string, boost::filesystem::path &gt;&#160;</td>
          <td class="paramname"><em>subdirectories</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates an ordered list of all subdirectories. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">directory</td><td>directory to find subdirectories in </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">subdirectores</td><td>multimap of subdirectories found </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a98f41161281f66a907466baae0000483"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int IOUtil::readCSVHeaderString </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::string &gt; &amp;&#160;</td>
          <td class="paramname"><em>header</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read header of CSV file into string array. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">header</td><td>header strings as vector </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9e7c777463186a87bc2cfe24396dba41"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int IOUtil::readCSVSummary </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::string &gt; &amp;&#160;</td>
          <td class="paramname"><em>row_headers</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::string &gt; &amp;&#160;</td>
          <td class="paramname"><em>col_headers</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read a CSV summary file as produced by <a class="el" href="classEvaluationSummary.html" title="Given a directory of superpixel segmentations and a directory of ground truth segmentations, this class is used to generate a CSV file of statistics of different metrics. ">EvaluationSummary</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to summary file </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">row_headers</td><td>row names (i.e. first column) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">col_headers</td><td>column names (i.e. first row) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>data corresponding to the inner of the CSV file </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9a2042854799a9885a77767b359c7b5c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void IOUtil::readDirectory </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>directory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::string &gt;&#160;</td>
          <td class="paramname"><em>extensions</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::multimap&lt; std::string, boost::filesystem::path &gt; &amp;&#160;</td>
          <td class="paramname"><em>files</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>prefix</em> = <code>&quot;&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>suffix</em> = <code>&quot;&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::string &gt;&#160;</td>
          <td class="paramname"><em>exclude</em> = <code>std::vector&lt;std::string&gt;{}</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates an ordered multimap of all files in the given directory. </p>
<p>Files must match one of the given extensions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">directory</td><td>directory to read </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">extensions</td><td>extensions to allow </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">files</td><td>files found in the directory </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">prefix</td><td>prefix to allow for files </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">suffix</td><td>suffix to allow for files </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">exclude</td><td>file names to exclude </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a582358728d3e0c09bd886db618c923e1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void IOUtil::readDirectory </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>directory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::multimap&lt; std::string, boost::filesystem::path &gt; &amp;&#160;</td>
          <td class="paramname"><em>files</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>prefix</em> = <code>&quot;&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>suffix</em> = <code>&quot;&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Creates an ordered multimap of all files in the given directory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">directory</td><td>directory to read </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">files</td><td>files found in the directory </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">prefix</td><td>prefix to allow for files </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">suffix</td><td>suffix to allow for files </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a46bb84fe3409d74aca7b2e9e2699e35e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int IOUtil::readMat </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>mat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>field</em> = <code>&quot;mat&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read an OpenCV matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file to read </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">mat</td><td>matrix read </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">field</td><td>the field the matrix was saved in, default is "mat" </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of rows read</dd></dl>
<p>Copyright (c) 2016, David Stutz Contact: <a href="#" onclick="location.href='mai'+'lto:'+'dav'+'id'+'.st'+'ut'+'z@r'+'wt'+'h-a'+'ac'+'hen'+'.d'+'e'; return false;">david<span style="display: none;">.nosp@m.</span>.stu<span style="display: none;">.nosp@m.</span>tz@rw<span style="display: none;">.nosp@m.</span>th-a<span style="display: none;">.nosp@m.</span>achen<span style="display: none;">.nosp@m.</span>.de</a>, davidstutz.de All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol type="1">
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </p>

</div>
</div>
<a class="anchor" id="a301206e86594f7eafa2a561bef4c1eaf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int IOUtil::readMatCSVFloat </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read CSV file into matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>matrix read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of rows read </dd></dl>

</div>
</div>
<a class="anchor" id="ad1b3f8c15c94c95a1e41d94bd651f3c8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int IOUtil::readMatCSVInt </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read CSV file into matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>matrix read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of rows read </dd></dl>

</div>
</div>
<a class="anchor" id="aac72206ef505345246b107ddabe12c11"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int IOUtil::readMatCSVInt </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rows</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cols</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read CSV file into matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rows</td><td>number of rows to read </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cols</td><td>number of cols to read </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>matrix read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of rows read </dd></dl>

</div>
</div>
<a class="anchor" id="ac6f4ce4f5fbab56c6febfb483e40284c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">template int IOUtil::writeArrayCSV&lt; unsigned char &gt; </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T **&#160;</td>
          <td class="paramname"><em>array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rows</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cols</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>separator</em> = <code>&quot;,&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>precision</em> = <code>6</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write two dimensional array to CSV file. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file to write </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">array</td><td>two-dimenstional array holding the data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rows</td><td>number of rows </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cols</td><td>number of cols </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">separator</td><td>separator to use for CSV </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">precision</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of rows read </dd></dl>

</div>
</div>
<a class="anchor" id="a446a98fc423c951454037129c46eec14"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int IOUtil::writeMat </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>mat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>field</em> = <code>&quot;mat&quot;</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write a matrix to the given file. </p>
<p>Will overwrite the file if it already exists.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file to (over-) write </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mat</td><td>matrix to write </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">field</td><td>the field the matrix was saved in, default is "mat" </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of rows written </dd></dl>

</div>
</div>
<a class="anchor" id="ab911811634c83c884c0acbc6b14c1321"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">template int IOUtil::writeMatCSV&lt; unsigned char &gt; </td>
          <td>(</td>
          <td class="paramtype">boost::filesystem::path&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const cv::Mat &amp;&#160;</td>
          <td class="paramname"><em>mat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>separator</em> = <code>&quot;,&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>precision</em> = <code>6</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write the content of a cv::Mat to a CSV file. </p>
<p>Only works for cv::Mats with one channel!</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>path to file to write </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mat</td><td>matrix to write </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">separator</td><td>separator to use for CSV </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">precision</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of rows read </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>lib_eval/<a class="el" href="io__util_8h_source.html">io_util.h</a></li>
<li>lib_eval/<a class="el" href="io__util_8cpp.html">io_util.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Apr 16 2017 16:39:17 for Superpixel Benchmark by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
